package com.crm.common.model.Enum;

public enum ResponseCodeEnum {

	OK("000000","成功"),
    ERROR("-1","操作失败,请稍后再试"),
    ERROR_001("-000000","操作被阻止"),
    NO_AUTH("-000001","暂无权限"),
	
	SERVICE_ERROR("900000","服务器错误"),
	BUSINESS_ERROR("800000","业务错误"),
	PARAMETER_ERROR("901000","请求参数错误"),
	CAPTCHA_ERROR("P03001","图形验证码错误，请重新获取"),
	CAPTCHA_INVALID("P03002","图片验证码失效，请重新获取"),
    PARAMETER_MISSING("902000","参数缺失"),

	FILE_NOT_EXIST("F00010","文件不存在"),
    PASSWORD_NOT_CHANGED_IN_80_DAYS("PWD080","近三个月未修改密码，请尽快修改"),
    PASSWORD_NOT_CHANGED_IN_90_DAYS("PWD090","三个月未修改密码，请修改后重新登录"),

    RESUME_TALENT_POOL_EXISTS("R00010","该简历人才库已经存在"),

	POOL_NAME_DUPLICATE("C00010","线索池名称已经重复"),
    POOL_CAPACITY_EXCEEDED("C00011","超出线索池容量"),

    CLUE_NAME_DUPLICATE("C00020","保存失败！公司名称和统一社会信用代码相同已存在"),
    CLUE_QCC_CHECK("C00030","企业信息有误，请核实！"),

    EXIST_NO_RETRIEVE_CLUE("C00001","存在未收回的线索,不能删除"),

    CUSTOMER_POOL_NAME_EXIST("CP0000","客户池名称已经存在"),
    NO_DEFAULT_CLUE_POOL("CP0001","不存在个人默认池不能分配,请联系管理员"),
    CUSTOMER_POOL_CAPACITY_EXCEEDED("CP0002","超出客户容量"),
    CUSTOMER_LOCKED("CL0001","客户已锁定"),

    IMPORT_COUNT_EXCEEDS_CAPACITY("CI0001","导入数量超过线索池容量，导入失败"),
    IMPORT_CUSTOMER_EXCEEDS_CAPACITY("IC0001","导入数量超过客户池容量，导入失败"),

    //产品管理--产品编码
    CUSTOMER_PRODUCT_NAME_REPEAT("PC0010","产品名称已存在"),
	CUSTOMER_PRODUCT_CODE_REPEAT("PC0011","产品编码已存在"),
    CUSTOMER_TOPIC_ID_REPEAT("PC0012","专题ID已存在"),

	//客户存在
    CUSTOMER_PRESENCE("CF0001","这个线索已经转过客户了"),
    CUSTOMER_EXCEED("CF0002","您已经有175个非会员客户了"),
    RECOVER_CUSTOMER_PRESENCE("CF0003","恢复失败，客户已经被分配/领取"),
    CUSTOMER_RELATION("CF0004","客户名称已关联客户,不能转化客户"),


	//活动存在
    PRODUCT_ACTIVITY_EXISTS("PA0001","保存失败,有效期内此活动已经存在"),

	//赠品活动是否存在
    PRODUCT_GIFT_ACTIVITY("PG0001","保存失败,此赠品活动已经存在"),

    //不能录入回款
    RNTURN_MONEY_EXIST("RM0001","不在回款录入时间范围内"),
    RETURN_MONEY_DATE_EXIST("RM0011","只能录入本月内的回款"),

    //回款金额不正确
    RNTURN_MONEY_TOOBIG("RM0002","录入回款总金额不能大于订单总金额"),
    //回款金额不正确
    PRODUCT_RNTURN_MONEY_TOOBIG("RM0013","操作失败，产品回款总额度不能大于产品成交价"),
    //未生效且未回款的合同不能作废
    DISABLE_CANCEL_CONTRACT("CO001","只有未生效且未回款的合同才能作废"),

    //合同审核未通过，不能回款
    RNTURN_MONEY_REVIEW("RM0003","该合同审核未审核/审核不通过，不能录入回款"),
    //订单作废不能录回款
    RNTURN_MONEY_ABOLISH("RM0004","该比订单已经作废，不能修改回款信息"),
    UPDATE_RNTURN_MONEY_ABOLISH("RM0004","该比订单已经作废，不能录入/修改回款信息"),
    RNTURN_MONEY_TIME_ERROR("RM0005","到款时间不能大于当前时间"),
    SHIFT_RETURN_MONEY_NOT_MATCHING("RM0006","全额关联金额与关联的合同总金额不匹配，关联失败"),
    SHIFT_RETURN_MONEY_EXIST("RM0007","该回款是关联来的，不能关联其他订单"),
    SHIFT_RETURN_MONEY_EQUALS("RM0008","关联失败，请输入正确的订单编号"),
    ORDER_RETURN_MONEY_EXIST("RM0009","关联失败，当前订单没有回款信息"),
    ALL_RETURN_MONEY_MAX("RM0010","操作失败，回款金额和订单尾款不一致"),
    UPDATE_RETURN_MONEY_MAX("RM0011","操作失败，全额回款不能修改回款金额"),
    RETURN_MONEY_BKSJ_ALL("RM0012","操作失败，补款升级合同只能全额回款"),

    //订单完成不能退款
    ORDER_FINISH_BACK_MONEY("OB0001","订单已经完成，不能退款"),
    //订单不存在
    SHIFT_ORDER_EXIST("OB0002","关联订单不存在，关联失败"),
    //订单产品不一致
    ORDER_PRODUCT_NOT_MATCHING("OB0003","关联订单产品不匹配，关联失败"),
    //订单状态
    ORDER_STATUS_RETURN_MONEY_EXIST("OB0004","关联订单已回款，关联失败"),
    //订单发票已开
    ORDER_RETURN_MONEY_INVOICE_EXIST("OB0005","当前订单有相关发票信息，关联失败"),
    //订单提成已发放
    ORDER_RETURN_MONEY_ROYALTY_EXIST("OB0006","当前订单有提成发放信息，关联失败"),

	//常用语不能超过10条
    PHRASE_EXCEED("CY0001","您已经有10条常用语了"),
    CUSTOMER_TAG_EXCEED("CT001","该标签已存在"),
    CUSTOMER_TAG_MORE("CT002","标签最多为10条"),

    //合同已生效不能编辑
    CONTRACT_CANNOT_EDITED("CV0001","合同已经生效不能编辑"),
    CONTRACT_CANNOT_SAVE("CV0002","没有会员产品不能保存"),
    CONTRACT_INSUFFICIENT_BALANCE("CV0003","余额不足,合同不能保存"),

    //发票已审批过
    ORDER_INVOICE_EDITED("OI0001","该开票信息已经审批过，不能再次审批"),
    ORDER_INVOICE_EDITED_DEL("OI0002","该开票信息已经审批过，不能撤回"),

    //该公司已经设置过税盘
    COMPANY_INVOICE_EDITED("SP0001","该公司已经设置了税盘，不能再次添加"),

    //客户充值信息已经审批
    CUSTOMER_PAY_EDITED("CZ0001","该调充值信息财务已经确认收款，不能修改/删除"),

    //token失效
    TOKEN_INVALID("401","token失效！"),

	//商机产品存在
    OPPORTUNITYPRODUCT_EX("EX0001","这个产品已存在"),

    //优惠券已存在
    COUPON_NAME_EX("CO0001","优惠券名称已存在"),
    COUPON_HAS_EXPIRED("CO0002","优惠券已失效"),

	PRODUCT_MEMBER_CARD_NAME_REPEAT("MP0001","会员卡名称已存在"),
    PRODUCT_MEMBER_PRODUCT_CODE_REPEAT("MP0002","会员产品编码已存在"),

    USER_ACCOUNT_IS_EXIST("UA0001","账号名已经存在，不能添加"),
    USER_EMAIL_NOT_EMPTY("UA0002","邮箱为空，不能添加"),

	//回复工单不能超过10条
    WORKORDER_EXCEED("WO0001","这个工单只能回复10条"),

    //新增工单信用值低于96分无法创建工单
    WORKORDER_CREDIT("WO0002","您的信用积分低于96分,无法创建工单,请联系管理员"),

	//会员卡没有了
    NOT_MEMBER_CARD("MC001","会员卡没有了"),

    MEMBERSHIP_NOT_EXPIRED("MNE0001","会员未到期不能释放！"),

    TRAINING_EXCEED("NX0001","最多创建10条内训！"),

    TRAINING_ITEM_EXCEED("NXI0001","最多创建10条内训需求项！"),

    COMPANY_NAME_ALREADY_EXISTS("CN0001","公司已存在"),
    COMPANY_NAME_NOT_EXSIT("CN0002","公司名称不存在！"),

    NOT_EXPORT_DATA("NO0001","没有可以导出的数据"),

    CUSTOMER_OR_CODE_NOT_EXIST("ME0001","客户名称或信用代码不存在！"),

    EDIT_TWO_SAME_TIME("ME0002","不能同时修改客户名称及社会信用代码"),

    CONTRACT_REVIEWED("CR0001","合同已经审核过"),

    //备案信息(客服部-》审核管理)
	CSD_RECORD_INFORMATION_COMPANY_NAME_REPEAT("CSD001","企业名称已重复"),
    CSD_RECORD_INFORMATION_UNIFIED_SOCIAL_CREDIT_CODE("CSD002","企业信用代码已重复"),

	//合同补款升级
    PRODUCT_REDEEMED("PR0001","该产品已经兑换，请重新选择"),

    //流水审核
    BANK_FLOW_EXAMINE_NOT_EXIST("BFE0001","流水审核不存在"),
    BANK_FLOW_EXAMINE_FAIL_1("BFE0002","审核失败：审核已通过"),
    BANK_FLOW_EXAMINE_FAIL_2("BFE0003","审核失败：审核已拒绝"),
    BANK_FLOW_EXAMINE_PASS_FAIL_HAS_CLOSE("BFE0004","不能通过审核：回款记录已封账"),
    BANK_FLOW_EXAMINE_BY_ORDER_PASS_FAIL_HAS_CLOSE("BFE0005","不能通过审核：有封账的回款记录"),
    BANK_FLOW_EXAMINE_BY_ORDER_PASS_FAIL_NOT_RETURN_MONEY("BFE0006","不能通过审核：没有回款记录"),
    BANK_FLOW_EXAMINE_BY_ORDER_PASS_FAIL_NOT_ALL_HAS_SERIAL("BFE0007","不能通过审核：有未关联流水的回款记录"),
    BANK_FLOW_EXAMINE_RELIEVE_RELATION_FAIL_EXAMINE_STATE_1("BFE0008","解除关联失败：正在审核"),
    BANK_FLOW_EXAMINE_RELIEVE_RELATION_FAIL_HAS_CLOSE("BFE0009","解除关联失败：有封账的回款记录"),
    BANK_FLOW_EXAMINE_RELIEVE_RELATION_FAIL_NOT_RETURN_MONEY("BFE0010","解除关联失败：没有回款记录"),
    BANK_FLOW_EXAMINE_RELIEVE_RELATION_FAIL_NOT_ALL_HAS_SERIAL("BFE0011","解除关联失败：有未关联流水的回款记录"),
    BANK_FLOW_EXAMINE_BY_ORDER_PASS_FAIL_HAS_PRE_RETURN("BFE0012","不能通过审核：有预回款记录"),
    BANK_FLOW_EXAMINE_RELIEVE_RELATION_FAIL_HAS_PRE_RETURN("BFE0013","解除关联失败：有预回款记录"),
    BANK_FLOW_EXAMINE_BY_ORDER_PASS_FAIL_PRE_RETURN("BFE0014","预回款订单不能通过审核"),
    BANK_FLOW_EXAMINE_RELIEVE_RELATION_FAIL_PRE_RETURN("BFE0015","预回款订单不能解除关联"),
    BANK_FLOW_RELATE_ORDER_EAMING("BFE0016","此订单正在审核中（整单解除），不允许关联！"),
    BANK_FLOW_NO_NOT_EXIST("BFE0017","操作失败，请输入正确的流水号"),
    BANK_FLOW_AVAILABLE_IS_NULL("BFE0018","操作失败，流水可用余额不足"),

    //预回款关联标识
    BANK_RELATE_SUCCESS_PRE_RETURNMONEY("BFR0000","当前流水的对方单位名称与关联订单的客户名称不一致，触发审核，当前回款为预回款"),


    //解除流水关联
    RELATE_BANK_ERROR("B00001","解除关联时参数错误"),
    CUSTOMER_PRODUCT_ORDER_NOT_EXIST("CPO0001","产品订单不存在"),
    //删除流水关联
    DELETE_BANK_ERROR("B00002","该流水已存在关联记录，不允许删除"),
    DELETE_BANK_FAIL("B00003","删除失败"),
    //流水关联客户充值
    BANK_RELATE_COMPANY_ERROR("B00004","所属分公司不是同一个！"),
    BALANCE_NOT_ENOUGH("B00005","可用余额不足"),
    BANK_TRANSACTIONDATE_ERROR("B00006","交易日期格式错误"),
    BANK_TRANSACTIONDATE_RANGE_ERROR("B00010","交易日期不在回款日期范围内！"),
    BANK_IS_EXSIT("B00007","流水已存在（流水号、交易日期、贷方金额确认唯一一条记录），请检查！"),
    ARRIVE_ACCOUNT_TYPE_NOT_EXSIT("B00008","收款方名称不存在！"),
    SUB_AVAILABLEAMOUNT_ERROR("B00009","调减金额不能大于可用金额！"),

    //回款审核
    RETURN_MONEY_EXAMINE_NOT_EXIST("RME0001","回款审核不存在"),
    RETURN_MONEY_EXAMINE_FAIL_2("RME0002","审核失败：审核已通过"),
    RETURN_MONEY_EXAMINE_FAIL_3("RME0003","审核失败：审核已拒绝"),
    RETURN_MONEY_EXAMINE_FAIL_UPLOAD_FILE("RME0004","审核失败：请联系业务员补充材料"),
    RETURN_MONEY_EXAMINE_FAIL_CUR_IS_CS("RME0005","审核失败：客服正在审核"),
    RETURN_MONEY_EXAMINE_FAIL_CUR_IS_FINANCE("RME0006","审核失败：财务正在审核"),
    RETURN_MONEY_EXAMINE_FAIL_CS_REJECT("RME0007","审核失败：客服审核不通过，您不能审核通过"),
    RETURN_MONEY_EXAMINE_FILE_IS_NULL("RME0008","请上传材料"),
    RETURN_MONEY_EXAMINE_UPLOAD_MATERIAL_FAIL_2("RME0009","上传材料失败：审核已通过"),
    RETURN_MONEY_EXAMINE_UPLOAD_MATERIAL_FAIL_3("RME0010","上传材料失败：审核已拒绝"),
    RETURN_MONEY_EXAMINE_UPLOAD_MATERIAL_FAIL_CS_EXAMINING("RME0011","上传材料失败：客服正在审核"),
    RETURN_MONEY_EXAMINE_UPLOAD_MATERIAL_FAIL_FINANCE_EXAMINING("RME0012","上传材料失败：财务正在审核"),
    RETURN_MONEY_EXAMINE_UPLOAD_MATERIAL_FAIL_UPLOADED_CS_EXAMINING("RME0013","上传材料失败：已上传，客服正在审核"),
    RETURN_MONEY_EXAMINE_UPLOAD_MATERIAL_FAIL_UPLOADED_FINANCE_EXAMINING("RME0014","上传材料失败：已上传，财务正在审核"),

    BANK_FLOW_EXIST_WHITE_LIST_NAME("BFWL0001","此白名单名称已经存在！");


    //防止字段值被修改，增加的字段也统一final表示常量
    private final String responseCode;
    private final String responseValue;
    
    ResponseCodeEnum(String responseCode, String responseValue){
        this.responseCode = responseCode;
        this.responseValue = responseValue;
    }
    //根据key获取枚举
    public static String getEnumValueByResponseCode(String responseCode){
        if(null == responseCode){
            return null;
        }
        for(ResponseCodeEnum temp:ResponseCodeEnum.values()){
            if(temp.getResponseCode().equals(responseCode)){
                return temp.getResponseValue();
            }
        }
        return null;
    }
    
    public String getResponseCode() {
        return responseCode;
    }
    public String getResponseValue() {
        return responseValue;
    }
}
